-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
支持非根URL/Add support for non-base url #270
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to your link to a discussion and this doc, it seems that the liquid filter relative_url
is a better choice. Also, not all absolute paths have been fixed (Not limited to files changed in this PR). I will only merge if all these changes are made.
从你给出的讨论和我查阅的文档来看,使用 relative_url
似乎更好。同时,还有很多绝对路径没有被修复。我只会在全部修复后合并该请求。
Thank you for your continuous effort in implementing this feature. However, as far as I know not all absolute paths have been fixed, for example, Also, there is inconsistency in your changes, namely mixing Since there are enormous codes using absolute paths, fully implementing this feature may be time-consuming as you and we need to develop and test it. It may be better to maintain your own fork, take time to fix all the absolute paths, and mark this PR as a draft before it is ready to get it upstreamed. |
用一种语言就行,不用这么累 |
|
昨日夜观加州天象,见一老者,曰:“你毕业前不把咕咕掉的PR解决,天必诛之!”,遂着急忙慌回到电脑前,复活此PR;冥冥之中又曰:“汝咕咕太久,开发太快,合并冲突已不可避。重置分支,放弃更改,重振旗鼓,从头开始,再强制推送到远端,可解合并冲突:此乃正道矣”
在
|
Reference to static files were absolute and did not support Jekyll's
baseurl
parametre, which, if the website is deployed with a url that isnot root (e.g.
mirrors.tuna.tsinghua.edu.cn/mirrors
), a 404 will bereturned when fetching static files as they are not correctly
referenced, causing the website to display that javascript was not
supported by the browser.
对静态文件的引用是绝对的(默认其在根目录下),并且不支持Jekyll的
baseurl
参数。这样一来,如果网站被部署在非根目录下(比如mirrors.tuna.tsinghua.edu.cn/mirrors
),由于静态文件没有被正确引用,在访问它们时会导致404,网站则因此会显示浏览器不支持JS。To solve this issue, this Q&A is referenced:
我参考了这个论坛问答,
https://talk.jekyllrb.com/t/relative-url-and-baseurl/2051,
by changing
href="/static/114514.js"
to"{{ site.baseurl }}/static/114514.js"
we can eliminate the problem.
如此修改可以解决这个问题。
Nevertheless, it should be noted that there may possibly be other
static references which this single commit did not cover.
不过,这个commit不一定修复了所有的静态引用(∮ ′⌒`)